<template>
	<view>
		<uni-swipe-action>
			<uni-swipe-action-item v-for="item in orderList" :key="item._id" :right-options="options">
				<!-- <img :src="item.goodsImgUrl" class="goods-img"> -->
				<view class="order-info">
					{{item.description}}
				</view>
			</uni-swipe-action-item>
		</uni-swipe-action>
	</view>
</template>

<script>
	const orderObj = uniCloud.importObject('orderlist')
	export default {
		data() {
			return {
				options: [{
					text: '取消',
					style: {
						backgroundColor: '#007aff'
					}
				}, {
					text: '确认',
					style: {
						backgroundColor: '#dd524d'
					}
				}],
				pageNum: 1,
				pageSize: 10,
				loading: false,
				orderList: [],
				hasMore: false
			}
		},
		onLoad() {
			this.getOrderList()
		},
		methods: {
			async getOrderList() {
				uni.showLoading({
					title: '加载中',
					mask: true
				})
				let res = await orderObj.getData({
					pageSize: this.pageSize,
					pageNum: this.pageNum
				})
				this.loading = false
				uni.hideLoading()
				this.orderList = res.data
				this.hasMore = res.hasMore
			}
		}
	}
</script>

<style>

</style>